import $http from '@/utils/request'

// custom部分参数说明: 
// isShowLoading: 请求时是否显示loadding, 默认为 true
// isShowErrorMsg: 请求出错时是否显示错误信息, 默认为 true
// isIntercept: 请求成功时返回状态码returnCode不为1000时,是否拦截前端返回, 默认为true

export function methodList(params){  //治疗方式列表List
	return $http.get('/rfdt/method/list', { data: params })
}

export function methodGetId(params){  //治疗方式详情
	return $http.get('/rfdt/method/getById', { data: params })
}

export function pubList(params){  //康复案例（已发布）List
	return $http.get('/rfdt/caseRecure/pubList', { data: params })
}

export function ownList(params){  //我的案例List
	return $http.get('/rfdt/caseRecure/ownList', { data: params })
}


export function pubGetId(params){  //案例ID详情
	return $http.get('/rfdt/caseRecure/getById', { data: params })
}

// export function getCaseComment(params){  //获取案例评价
// 	return $http.get('/rfdt/caseComment/getAll', { data: params })
// }

export function getCaseComment(params){  //获取案例评价
	return $http.get('/rfdt/caseComment/list', { data: params })
}

export function caseCommentAdd(params){  //新增案例评价评论
	return $http.request({
		method:"POST",
		url:"/rfdt/caseComment/add",
		data: params,
		custom:{
			loadingText: '评论中'
		}
	})
}

export function caseCommentReply(params){  //新增案例评价回复评论
	return $http.request({
		method:"POST",
		url:"/rfdt/caseComment/replyComment",
		data: params,
		custom:{
			loadingText: '评论中'
		}
	})
}

export function changeCaseFollowAdd(params){  //用户点赞收藏
	return $http.request({
		method:"POST",
		url:"/rfdt/caseFollow/changeCaseFollow",
		data: params,
		custom:{
			isShowLoading: false
		}
	})
}

export function getUserCaseFollow(params){  //获取登陆用户对某个案例的点赞收藏数据
	return $http.get('/rfdt/caseFollow/getUserCaseFollow', { data: params })
}

